/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.core.repository.jpa;

import com.intelligent.ispc.core.entity.TestFile;
import com.intelligent.ispc.foundation.repository.jpa.BaseRepository;
import com.intelligent.ispc.utils.TestFileStatus;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by dmrj on 2015/10/22.
 */
public interface TestFileDao extends BaseRepository<TestFile, Long>, PagingAndSortingRepository<TestFile, Long>, JpaSpecificationExecutor<TestFile> {
    TestFile findByTestFileUUID(String testFileUUID);

    TestFile findById(Long id);

    List<TestFile> findByOriginalNameAndProjectIdAndDataType(String originalName, Long projectId, String dataType);

    List<TestFile> findByOriginalNameAndProjectIdAndIsDeleteAndDataType(String originalName, Long projectId, boolean isDelete, String dataType);

    List<TestFile> findByOriginalNameInAndProjectIdAndIsDeleteAndDataType(List<String> originalNames, Long projectId, boolean isDelete, String dataType);

    List<TestFile> findByOriginalNameAndProjectIdAndStatusAndDataType(String originalName, Long projectId, TestFileStatus status, String datType);

    List<TestFile> findByProjectIdAndDataType(Long projectId, String dataType);

    List<TestFile> findByProjectIdAndIsDeleteAndDataType(Long projectId, boolean isDelete, String dataType);

}